/*
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.

Anser:9110846700
Time:2.205359ms
*/
package main

import (
	"fmt"
	"time"
)

func main() {
	tstart := time.Now()
	s := 0
	for i := 1; i <= 1000; i++ {
		s += power(i)
	}
	fmt.Println(s % 1e10)
	tend := time.Now()
	fmt.Println(tend.Sub(tstart))
}
func power(n int) int {
	s := 1
	for i := 0; i < n; i++ {
		s *= n
		s %= 1e10
	}
	return s
}
